set nocompatible
filetype off

" set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin()
" call vundle#end()

call plug#begin('~/.vim/plugged')

Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }

Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
Plug 'plasticboy/vim-markdown'
Plug 'tpope/vim-commentary'
Plug 'Yggdroot/indentLine'

Plug 'itchyny/lightline.vim'
Plug 'ap/vim-css-color'

" Plug 'PotatoesMaster/i3-vim-syntax'
" Plug 'kovetskiy/sxhkd-vim'

" --THEMES ---
Plug 'rakr/vim-one'
Plug 'ayu-theme/ayu-vim'
Plug 'liuchengxu/space-vim-dark'
Plug 'sainnhe/sonokai' 
Plug 'nanotech/jellybeans.vim' , {'as': 'jellybeans'}

Plug 'matze/vim-move'
Plug 'ifsmirnov/vim-searchindex'
" Plug 'RRethy/vim-illuminate'

call plug#end()

filetype plugin on
syntax on


let ayucolor="dark"
colorscheme ayu
" colorscheme one 

let g:lightline = { 'colorscheme': 'darcula' }
set laststatus=2

"################################################################################
"# --------------------------      KEYBINDINGS      --------------------------- #
"################################################################################

inoremap jk <Esc>
" vnoremap jk <Esc> 

map <C-_> :Commentary<CR>
map <C-n> :NERDTreeToggle<CR>

map <C-t> :tabnew<CR>
nnoremap td  :tabclose<CR>
nnoremap H gT
nnoremap L gt

nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

let g:move_key_modifier = 'C'
let g:ycm_add_preview_to_completeopt = 0 

set nu rnu
set nowrap
set mouse=a
set cursorline
set clipboard=unnamedplus
set scrolloff=3 sidescroll=1 sidescrolloff=10
set completeopt-=preview noshowmode

set confirm equalalways

if has("nvim") 
  set inccommand=split
endif

"################################################################################
"# --------------------------      INDENTATION      --------------------------- #
"################################################################################

nnoremap <Tab> >>_
nnoremap <S-Tab> <<_
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
" inoremap <S-Tab> <C-D>

set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set autoindent
set backspace=indent,eol,start whichwrap+=<,>,[,]


"################################################################################
"# -----------------------------      OTHER      ------------------------------ #
"################################################################################

set ignorecase
set smartcase
" set noincsearch
set autoread
set wildmenu

set nobackup
set noswapfile
set encoding=utf-8
set termencoding=utf-8
set fileencodings=utf8,cp1251

if has('termguicolors')
  set termguicolors
endif
